<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        // 之前的函数
        // 1.使用function命令声明
        function a(x, y) {
            return x + y;
        }

        // 2.函数表达式声明函数
        let b = function(x, y) {
            return x * y;
        }

        // 3.构造函数方法声明
        let c = new Function('x', 'y', 'return x+y');

        // 4.自调用形式

        (function(x, y) {
            console.log(x + y)
        })(3, 6);
        ! function(x, y) {
            console.log(x + y)
        }(3, 6);

        +

        function(x, y) {
            console.log(x + y)
        }(3, 6);
        ~ function(x, y) {
            console.log(x + y)
        }(3, 6);
    </script>
</body>

</html>